package com.biscuit.page.basicservice.api;

import com.biscuit.common.base.*;
import com.biscuit.page.basicservice.api.model.request.chat.*;
import com.biscuit.page.basicservice.api.model.response.chat.ChatRoomInfoAResp;
import com.biscuit.page.basicservice.api.model.response.chat.ChatRoomMessageAResp;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

/**
 * @author biscuit
 * @createTime 2024/6/11 9:00
 */
@Api(tags = "聊天室相关")
@RequestMapping("/chatRoom/")
public interface IChatRemote {

    @ApiOperation(value = "后置初始化")
    @GetMapping("/initAfter/{chatRoomId}")
    BaseResponse<BaseResponseVoid> initAfter(@PathVariable("chatRoomId") Long chatRoomId);

    @ApiOperation(value = "获取聊天室详情信息")
    @GetMapping("/getChatRoomInfo/{chatRoomId}")
    BaseResponse<ChatRoomInfoAResp> getChatRoomInfo(@PathVariable("chatRoomId") Long chatRoomId);

    @ApiOperation(value = "新建聊天室")
    @PostMapping("/saveChatRoom")
    BaseResponse<ChatRoomInfoAResp> saveChatRoom(@RequestBody ChatRoomNewCreateAReq req);

    @ApiOperation(value = "分页获取指定聊天室的聊天消息")
    @PostMapping("/pageMessageByChatRoomId")
    BaseResponse<BasePageListResponse<ChatRoomMessageAResp>> pageMessageByChatRoomId(@RequestBody ChatRoomMessagePageAReq req);

    @ApiOperation(value = "聊天室消息发送前置操作（获取聊天消息ID）")
    @PostMapping("/execBeforeMessagePublishToChatRoom")
    BaseResponse<BaseModelResponse<Long>> execBeforeMessagePublishToChatRoom(@RequestBody ChatRoomMessageSaveBeforeAReq req);

    @ApiOperation(value = "向指定聊天室中发布一条新消息")
    @PostMapping("/saveMessageToChatRoom")
    BaseResponse<BaseModelResponse<Boolean>> saveMessageToChatRoom(@RequestBody ChatRoomMessageSaveAReq req);

    @ApiOperation(value = "获取指定聊天室在线用户信息")
    @GetMapping("/getChatRoomOnlineInfo/{chatRoomId}")
    BaseResponse<BaseListResponse<ChatRoomOnlineAReq>> getChatRoomOnlineInfo(@PathVariable("chatRoomId") Long chatRoomId);


    // =============================================  楚河汉界  ======================================================


    @ApiOperation(value = "获取指定聊天室的所有在线用户")
    @GetMapping("/listOnline/{chatRoomId}")
    BaseResponse<BaseListResponse<ChatRoomOnlineAReq>> listOnline(@PathVariable("chatRoomId") Long chatRoomId);


}
